package com.stox.client.ui.javafx.chartingy.persistence.chart.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.stox.client.ui.javafx.chartingy.model.shape.ControlPoint;
import com.stox.client.ui.javafx.chartingy.model.shape.Shape;

public class ShapeDTO implements Serializable {
	private static final long serialVersionUID = 1L;

	private List<ControlPointDTO> controlPoints = new ArrayList<>();
	
	public ShapeDTO() {
		
	}

	public ShapeDTO(Shape shape) {
		ControlPoint[] controlPoints = shape.getControlPoints();
		if(null != controlPoints && 0 < controlPoints.length){
			for(ControlPoint controlPoint : controlPoints){
				this.controlPoints.add(new ControlPointDTO(controlPoint));
			}
		}
	}
	
	public List<ControlPointDTO> getControlPoints() {
		return controlPoints;
	}

	public void setControlPoints(List<ControlPointDTO> controlPoints) {
		this.controlPoints = controlPoints;
	}
	
}
